package org.batyrov.equery.console.action;

import org.batyrov.equery.console.control.Main;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.net.URL;
import java.net.URLConnection;
import java.io.*;


/**
 * Created by IntelliJ IDEA.
 * User: admin
 * Date: 15.09.2009
 * Time: 23:51:17
 * To change this template use File | Settings | File Templates.
 */
public class ClientCall implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        try {
            URLConnection url = new URL(Main.getConfiguration().getProperty("server.url")+"/console/TxtNextClient.html").openConnection();
            BufferedReader in = new BufferedReader(new InputStreamReader(url.getInputStream()));
            String str = "";
            while(str != null){
                str = in.readLine();
                System.out.println(str);
            }
            
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }
}
